package com.tianji.learning.controller;

import com.tianji.learning.domain.vo.SignResultVO;
import com.tianji.learning.service.SignRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Component
@Slf4j
@RestController
@RequestMapping("/sign-records")
@Api("签到相关接口")
@RequiredArgsConstructor
public class SignRecordController {

    private final SignRecordService signRecordService;

    @PostMapping
    @ApiOperation("签到")
    public SignResultVO addSignRecords(){
        return signRecordService.addSignRecords();
    }

    @ApiOperation("查询签到记录")
    @GetMapping
    public Byte[] getSignRecords(){
        return signRecordService.getSignRecords();
    }
}
